package com.eshop.modules.product.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eshop.modules.category.domain.StoreCategory;
import javax.validation.constraints.Min;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

@TableName("store_product")
public class StoreProduct extends BaseDomain
{
    @TableId
    @ApiModelProperty("商品ID")
    private Long id;
    @ApiModelProperty("商户Id(0为总后台管理员创建,不为0的时候是商户后台创建) 预留字段")
    private Integer merId;
    @NotBlank(message = "请上传商品图片")
    @ApiModelProperty("商品图片")
    private String image;
    @NotBlank(message = "请上传商品轮播图")
    @ApiModelProperty("商品轮播图")
    private String sliderImage;
    @NotBlank(message = "商品名称不能空")
    @ApiModelProperty("商品名称")
    private String storeName;
    @ApiModelProperty("商品简介")
    private String storeInfo;
    @ApiModelProperty("关键字")
    private String keyword;
    @ApiModelProperty("产品条码（一维码）")
    private String barCode;
    @ApiModelProperty("分类id")
    private String cateId;
    @ApiModelProperty("商品价格")
    @NotNull(message = "请输入商品价格")
    @DecimalMin(value = "0.00", message = "商品价格不在合法范围内")
    @DecimalMax(value = "99999999.99", message = "商品价格不在合法范围内")
    private BigDecimal price;
    @ApiModelProperty("会员价格")
    private BigDecimal vipPrice;
    @ApiModelProperty("市场价")
    @NotNull(message = "请输入市场价")
    @DecimalMin(value = "0.00", message = "市场价不在合法范围内")
    @DecimalMax(value = "99999999.99", message = "市场价不在合法范围内")
    private BigDecimal otPrice;
    @ApiModelProperty("邮费")
    private BigDecimal postage;
    @NotBlank(message = "请填写单位")
    @ApiModelProperty("单位名")
    private String unitName;
    @ApiModelProperty("排序")
    private Integer sort;
    @ApiModelProperty("销量")
    private Integer sales;
    @ApiModelProperty("库存")
    @NotNull(message = "请输入库存")
    @Min(message = "库存不能小于0", value = 1L)
    private Integer stock;
    @ApiModelProperty("需要多少积分兑换 只在开启积分兑换时生效")
    private Integer integral;
    @ApiModelProperty("状态（0：未上架，1：上架）")
    private Integer isShow;
    @ApiModelProperty("是否热卖（0：否，1：是）")
    private Integer isHot;
    @ApiModelProperty("是否猜你喜欢（0：否，1：是）")
    private Integer isBenefit;
    @ApiModelProperty("是否精品（0：否，1：是）")
    private Integer isBest;
    @ApiModelProperty("是否新品（0：否，1：是）")
    private Integer isNew;
    @NotBlank(message = "请填写商品详情")
    @ApiModelProperty("商品详情")
    private String description;
    @ApiModelProperty("是否包邮")
    private Integer isPostage;
    @ApiModelProperty("商户是否代理 0不可代理1可代理 ")
    private Integer merUse;
    @ApiModelProperty("获得积分")
    @DecimalMin(value = "0.00", message = "获得积分不在合法范围内")
    @DecimalMax(value = "99999999.99", message = "获得积分不在合法范围内")
    private BigDecimal giveIntegral;
    @ApiModelProperty("成本价")
    @NotNull(message = "请输入成本价")
    @DecimalMin(value = "0.00", message = "成本价不在合法范围内")
    @DecimalMax(value = "99999999.99", message = "成本价不在合法范围内")
    private BigDecimal cost;
    @ApiModelProperty("秒杀状态 0 未开启 1已开启")
    private Integer isSeckill;
    @ApiModelProperty("砍价状态 0 未开启 1已开启")
    private Integer isBargain;
    @ApiModelProperty("是否优品推荐（0：否，1：是）")
    private Integer isGood;
    @ApiModelProperty("虚拟销量")
    private Integer ficti;
    @ApiModelProperty("浏览量")
    private Integer browse;
    @ApiModelProperty("品二维码地址(用户小程序海报) ")
    private String codePath;
    @ApiModelProperty("邮费模版ID")
    private Integer tempId;
    @ApiModelProperty("规格 0单 1多 ")
    private Integer specType;
    @ApiModelProperty("是否单独分佣")
    private Integer isSub;
    @ApiModelProperty("是否开启积分兑换")
    private Integer isIntegral;
    @TableField(exist = false)
    private StoreCategory storeCategory;
    
    public void copy(final StoreProduct source) {
        BeanUtil.copyProperties((Object)source, (Object)this, CopyOptions.create().setIgnoreNullValue(true));
    }
    
    public static StoreProductBuilder builder() {
        return new StoreProductBuilder();
    }
    
    public StoreProduct(final Long id, final Integer merId, final String image, final String sliderImage, final String storeName, final String storeInfo, final String keyword, final String barCode, final String cateId, final BigDecimal price, final BigDecimal vipPrice, final BigDecimal otPrice, final BigDecimal postage, final String unitName, final Integer sort, final Integer sales, final Integer stock, final Integer integral, final Integer isShow, final Integer isHot, final Integer isBenefit, final Integer isBest, final Integer isNew, final String description, final Integer isPostage, final Integer merUse, final BigDecimal giveIntegral, final BigDecimal cost, final Integer isSeckill, final Integer isBargain, final Integer isGood, final Integer ficti, final Integer browse, final String codePath, final Integer tempId, final Integer specType, final Integer isSub, final Integer isIntegral, final StoreCategory storeCategory) {
        this.id = id;
        this.merId = merId;
        this.image = image;
        this.sliderImage = sliderImage;
        this.storeName = storeName;
        this.storeInfo = storeInfo;
        this.keyword = keyword;
        this.barCode = barCode;
        this.cateId = cateId;
        this.price = price;
        this.vipPrice = vipPrice;
        this.otPrice = otPrice;
        this.postage = postage;
        this.unitName = unitName;
        this.sort = sort;
        this.sales = sales;
        this.stock = stock;
        this.integral = integral;
        this.isShow = isShow;
        this.isHot = isHot;
        this.isBenefit = isBenefit;
        this.isBest = isBest;
        this.isNew = isNew;
        this.description = description;
        this.isPostage = isPostage;
        this.merUse = merUse;
        this.giveIntegral = giveIntegral;
        this.cost = cost;
        this.isSeckill = isSeckill;
        this.isBargain = isBargain;
        this.isGood = isGood;
        this.ficti = ficti;
        this.browse = browse;
        this.codePath = codePath;
        this.tempId = tempId;
        this.specType = specType;
        this.isSub = isSub;
        this.isIntegral = isIntegral;
        this.storeCategory = storeCategory;
    }
    
    public StoreProduct() {
    }
    
    public Long getId() {
        return this.id;
    }
    
    public Integer getMerId() {
        return this.merId;
    }
    
    public String getImage() {
        return this.image;
    }
    
    public String getSliderImage() {
        return this.sliderImage;
    }
    
    public String getStoreName() {
        return this.storeName;
    }
    
    public String getStoreInfo() {
        return this.storeInfo;
    }
    
    public String getKeyword() {
        return this.keyword;
    }
    
    public String getBarCode() {
        return this.barCode;
    }
    
    public String getCateId() {
        return this.cateId;
    }
    
    public BigDecimal getPrice() {
        return this.price;
    }
    
    public BigDecimal getVipPrice() {
        return this.vipPrice;
    }
    
    public BigDecimal getOtPrice() {
        return this.otPrice;
    }
    
    public BigDecimal getPostage() {
        return this.postage;
    }
    
    public String getUnitName() {
        return this.unitName;
    }
    
    public Integer getSort() {
        return this.sort;
    }
    
    public Integer getSales() {
        return this.sales;
    }
    
    public Integer getStock() {
        return this.stock;
    }
    
    public Integer getIntegral() {
        return this.integral;
    }
    
    public Integer getIsShow() {
        return this.isShow;
    }
    
    public Integer getIsHot() {
        return this.isHot;
    }
    
    public Integer getIsBenefit() {
        return this.isBenefit;
    }
    
    public Integer getIsBest() {
        return this.isBest;
    }
    
    public Integer getIsNew() {
        return this.isNew;
    }
    
    public String getDescription() {
        return this.description;
    }
    
    public Integer getIsPostage() {
        return this.isPostage;
    }
    
    public Integer getMerUse() {
        return this.merUse;
    }
    
    public BigDecimal getGiveIntegral() {
        return this.giveIntegral;
    }
    
    public BigDecimal getCost() {
        return this.cost;
    }
    
    public Integer getIsSeckill() {
        return this.isSeckill;
    }
    
    public Integer getIsBargain() {
        return this.isBargain;
    }
    
    public Integer getIsGood() {
        return this.isGood;
    }
    
    public Integer getFicti() {
        return this.ficti;
    }
    
    public Integer getBrowse() {
        return this.browse;
    }
    
    public String getCodePath() {
        return this.codePath;
    }
    
    public Integer getTempId() {
        return this.tempId;
    }
    
    public Integer getSpecType() {
        return this.specType;
    }
    
    public Integer getIsSub() {
        return this.isSub;
    }
    
    public Integer getIsIntegral() {
        return this.isIntegral;
    }
    
    public StoreCategory getStoreCategory() {
        return this.storeCategory;
    }
    
    public void setId(final Long id) {
        this.id = id;
    }
    
    public void setMerId(final Integer merId) {
        this.merId = merId;
    }
    
    public void setImage(final String image) {
        this.image = image;
    }
    
    public void setSliderImage(final String sliderImage) {
        this.sliderImage = sliderImage;
    }
    
    public void setStoreName(final String storeName) {
        this.storeName = storeName;
    }
    
    public void setStoreInfo(final String storeInfo) {
        this.storeInfo = storeInfo;
    }
    
    public void setKeyword(final String keyword) {
        this.keyword = keyword;
    }
    
    public void setBarCode(final String barCode) {
        this.barCode = barCode;
    }
    
    public void setCateId(final String cateId) {
        this.cateId = cateId;
    }
    
    public void setPrice(final BigDecimal price) {
        this.price = price;
    }
    
    public void setVipPrice(final BigDecimal vipPrice) {
        this.vipPrice = vipPrice;
    }
    
    public void setOtPrice(final BigDecimal otPrice) {
        this.otPrice = otPrice;
    }
    
    public void setPostage(final BigDecimal postage) {
        this.postage = postage;
    }
    
    public void setUnitName(final String unitName) {
        this.unitName = unitName;
    }
    
    public void setSort(final Integer sort) {
        this.sort = sort;
    }
    
    public void setSales(final Integer sales) {
        this.sales = sales;
    }
    
    public void setStock(final Integer stock) {
        this.stock = stock;
    }
    
    public void setIntegral(final Integer integral) {
        this.integral = integral;
    }
    
    public void setIsShow(final Integer isShow) {
        this.isShow = isShow;
    }
    
    public void setIsHot(final Integer isHot) {
        this.isHot = isHot;
    }
    
    public void setIsBenefit(final Integer isBenefit) {
        this.isBenefit = isBenefit;
    }
    
    public void setIsBest(final Integer isBest) {
        this.isBest = isBest;
    }
    
    public void setIsNew(final Integer isNew) {
        this.isNew = isNew;
    }
    
    public void setDescription(final String description) {
        this.description = description;
    }
    
    public void setIsPostage(final Integer isPostage) {
        this.isPostage = isPostage;
    }
    
    public void setMerUse(final Integer merUse) {
        this.merUse = merUse;
    }
    
    public void setGiveIntegral(final BigDecimal giveIntegral) {
        this.giveIntegral = giveIntegral;
    }
    
    public void setCost(final BigDecimal cost) {
        this.cost = cost;
    }
    
    public void setIsSeckill(final Integer isSeckill) {
        this.isSeckill = isSeckill;
    }
    
    public void setIsBargain(final Integer isBargain) {
        this.isBargain = isBargain;
    }
    
    public void setIsGood(final Integer isGood) {
        this.isGood = isGood;
    }
    
    public void setFicti(final Integer ficti) {
        this.ficti = ficti;
    }
    
    public void setBrowse(final Integer browse) {
        this.browse = browse;
    }
    
    public void setCodePath(final String codePath) {
        this.codePath = codePath;
    }
    
    public void setTempId(final Integer tempId) {
        this.tempId = tempId;
    }
    
    public void setSpecType(final Integer specType) {
        this.specType = specType;
    }
    
    public void setIsSub(final Integer isSub) {
        this.isSub = isSub;
    }
    
    public void setIsIntegral(final Integer isIntegral) {
        this.isIntegral = isIntegral;
    }
    
    public void setStoreCategory(final StoreCategory storeCategory) {
        this.storeCategory = storeCategory;
    }
    
    public static class StoreProductBuilder
    {
        private Long id;
        private Integer merId;
        private String image;
        private String sliderImage;
        private String storeName;
        private String storeInfo;
        private String keyword;
        private String barCode;
        private String cateId;
        private BigDecimal price;
        private BigDecimal vipPrice;
        private BigDecimal otPrice;
        private BigDecimal postage;
        private String unitName;
        private Integer sort;
        private Integer sales;
        private Integer stock;
        private Integer integral;
        private Integer isShow;
        private Integer isHot;
        private Integer isBenefit;
        private Integer isBest;
        private Integer isNew;
        private String description;
        private Integer isPostage;
        private Integer merUse;
        private BigDecimal giveIntegral;
        private BigDecimal cost;
        private Integer isSeckill;
        private Integer isBargain;
        private Integer isGood;
        private Integer ficti;
        private Integer browse;
        private String codePath;
        private Integer tempId;
        private Integer specType;
        private Integer isSub;
        private Integer isIntegral;
        private StoreCategory storeCategory;
        
        StoreProductBuilder() {
        }
        
        public StoreProductBuilder id(final Long id) {
            this.id = id;
            return this;
        }
        
        public StoreProductBuilder merId(final Integer merId) {
            this.merId = merId;
            return this;
        }
        
        public StoreProductBuilder image(final String image) {
            this.image = image;
            return this;
        }
        
        public StoreProductBuilder sliderImage(final String sliderImage) {
            this.sliderImage = sliderImage;
            return this;
        }
        
        public StoreProductBuilder storeName(final String storeName) {
            this.storeName = storeName;
            return this;
        }
        
        public StoreProductBuilder storeInfo(final String storeInfo) {
            this.storeInfo = storeInfo;
            return this;
        }
        
        public StoreProductBuilder keyword(final String keyword) {
            this.keyword = keyword;
            return this;
        }
        
        public StoreProductBuilder barCode(final String barCode) {
            this.barCode = barCode;
            return this;
        }
        
        public StoreProductBuilder cateId(final String cateId) {
            this.cateId = cateId;
            return this;
        }
        
        public StoreProductBuilder price(final BigDecimal price) {
            this.price = price;
            return this;
        }
        
        public StoreProductBuilder vipPrice(final BigDecimal vipPrice) {
            this.vipPrice = vipPrice;
            return this;
        }
        
        public StoreProductBuilder otPrice(final BigDecimal otPrice) {
            this.otPrice = otPrice;
            return this;
        }
        
        public StoreProductBuilder postage(final BigDecimal postage) {
            this.postage = postage;
            return this;
        }
        
        public StoreProductBuilder unitName(final String unitName) {
            this.unitName = unitName;
            return this;
        }
        
        public StoreProductBuilder sort(final Integer sort) {
            this.sort = sort;
            return this;
        }
        
        public StoreProductBuilder sales(final Integer sales) {
            this.sales = sales;
            return this;
        }
        
        public StoreProductBuilder stock(final Integer stock) {
            this.stock = stock;
            return this;
        }
        
        public StoreProductBuilder integral(final Integer integral) {
            this.integral = integral;
            return this;
        }
        
        public StoreProductBuilder isShow(final Integer isShow) {
            this.isShow = isShow;
            return this;
        }
        
        public StoreProductBuilder isHot(final Integer isHot) {
            this.isHot = isHot;
            return this;
        }
        
        public StoreProductBuilder isBenefit(final Integer isBenefit) {
            this.isBenefit = isBenefit;
            return this;
        }
        
        public StoreProductBuilder isBest(final Integer isBest) {
            this.isBest = isBest;
            return this;
        }
        
        public StoreProductBuilder isNew(final Integer isNew) {
            this.isNew = isNew;
            return this;
        }
        
        public StoreProductBuilder description(final String description) {
            this.description = description;
            return this;
        }
        
        public StoreProductBuilder isPostage(final Integer isPostage) {
            this.isPostage = isPostage;
            return this;
        }
        
        public StoreProductBuilder merUse(final Integer merUse) {
            this.merUse = merUse;
            return this;
        }
        
        public StoreProductBuilder giveIntegral(final BigDecimal giveIntegral) {
            this.giveIntegral = giveIntegral;
            return this;
        }
        
        public StoreProductBuilder cost(final BigDecimal cost) {
            this.cost = cost;
            return this;
        }
        
        public StoreProductBuilder isSeckill(final Integer isSeckill) {
            this.isSeckill = isSeckill;
            return this;
        }
        
        public StoreProductBuilder isBargain(final Integer isBargain) {
            this.isBargain = isBargain;
            return this;
        }
        
        public StoreProductBuilder isGood(final Integer isGood) {
            this.isGood = isGood;
            return this;
        }
        
        public StoreProductBuilder ficti(final Integer ficti) {
            this.ficti = ficti;
            return this;
        }
        
        public StoreProductBuilder browse(final Integer browse) {
            this.browse = browse;
            return this;
        }
        
        public StoreProductBuilder codePath(final String codePath) {
            this.codePath = codePath;
            return this;
        }
        
        public StoreProductBuilder tempId(final Integer tempId) {
            this.tempId = tempId;
            return this;
        }
        
        public StoreProductBuilder specType(final Integer specType) {
            this.specType = specType;
            return this;
        }
        
        public StoreProductBuilder isSub(final Integer isSub) {
            this.isSub = isSub;
            return this;
        }
        
        public StoreProductBuilder isIntegral(final Integer isIntegral) {
            this.isIntegral = isIntegral;
            return this;
        }
        
        public StoreProductBuilder storeCategory(final StoreCategory storeCategory) {
            this.storeCategory = storeCategory;
            return this;
        }
        
        public StoreProduct build() {
            return new StoreProduct(this.id, this.merId, this.image, this.sliderImage, this.storeName, this.storeInfo, this.keyword, this.barCode, this.cateId, this.price, this.vipPrice, this.otPrice, this.postage, this.unitName, this.sort, this.sales, this.stock, this.integral, this.isShow, this.isHot, this.isBenefit, this.isBest, this.isNew, this.description, this.isPostage, this.merUse, this.giveIntegral, this.cost, this.isSeckill, this.isBargain, this.isGood, this.ficti, this.browse, this.codePath, this.tempId, this.specType, this.isSub, this.isIntegral, this.storeCategory);
        }
        
        @Override
        public String toString() {
            return "StoreProduct.StoreProductBuilder(id=" + this.id + ", merId=" + this.merId + ", image=" + this.image + ", sliderImage=" + this.sliderImage + ", storeName=" + this.storeName + ", storeInfo=" + this.storeInfo + ", keyword=" + this.keyword + ", barCode=" + this.barCode + ", cateId=" + this.cateId + ", price=" + this.price + ", vipPrice=" + this.vipPrice + ", otPrice=" + this.otPrice + ", postage=" + this.postage + ", unitName=" + this.unitName + ", sort=" + this.sort + ", sales=" + this.sales + ", stock=" + this.stock + ", integral=" + this.integral + ", isShow=" + this.isShow + ", isHot=" + this.isHot + ", isBenefit=" + this.isBenefit + ", isBest=" + this.isBest + ", isNew=" + this.isNew + ", description=" + this.description + ", isPostage=" + this.isPostage + ", merUse=" + this.merUse + ", giveIntegral=" + this.giveIntegral + ", cost=" + this.cost + ", isSeckill=" + this.isSeckill + ", isBargain=" + this.isBargain + ", isGood=" + this.isGood + ", ficti=" + this.ficti + ", browse=" + this.browse + ", codePath=" + this.codePath + ", tempId=" + this.tempId + ", specType=" + this.specType + ", isSub=" + this.isSub + ", isIntegral=" + this.isIntegral + ", storeCategory=" + this.storeCategory + ")";
        }
    }
}
